package model.building;

import model.City;
import model.Ressources;
import model.util.Vector3D;
import model.util.Object3D;
import model.util.Box3D;

public abstract class Service extends Building {

    /** Constructeurs */
    public Service(City city, Object3D object3d, Activity activity) {
        super(city, object3d, activity); 
    }

    /** Classe internes */
    public static abstract class Activity extends Building.Activity {
        
        /** Attributs */
        private double m_personLimit, m_dollars;

        /** Constructeurs */
        public Activity(Activity activity) {
            super(activity);
            m_personLimit = activity.m_personLimit;
            m_dollars = activity.m_dollars;
        }
        
        public Activity(double personLimit, double dollars) {
            m_personLimit = personLimit;
            m_dollars = dollars;
        }

        /** Methodes */
        public void construct(Ressources economy) {
            economy.incLimit(Ressources.Type.PERSONS, m_personLimit); 
        }

        public void update(double deltaTps, Ressources economy) {
            economy.remove(Ressources.Type.DOLLARS, m_dollars * deltaTps); 
        }
        
        public void destroy(Ressources economy) { 
            economy.decLimit(Ressources.Type.PERSONS, m_personLimit); 
        }
    }
}
